package project

import (
	"github.com/gin-gonic/gin"
	"log"
	"test.com/project-api/api/midd"
	"test.com/project-api/api/rpc"
	"test.com/project-api/router"
)

type RouterProject struct {
}

func init() {
	log.Println("init Project router")
	ru := &RouterProject{}
	router.Register(ru)
}

func (*RouterProject) Route(r *gin.Engine) {
	rpc.InitRpcProjectClient()
	h := New()
	group := r.Group("/project")
	group.Use(midd.TokenVerify())
	group.POST("/index", h.index)                                    //首页
	group.POST("/project/selfList", h.myProjectList)                 //项目列表
	group.POST("/project", h.myProjectList)                          //我的项目
	group.POST("/project_template", h.projectTemplate)               //项目模版
	group.POST("/project/save", h.projectSave)                       //创建项目
	group.POST("/project/read", h.readProject)                       //读取项目
	group.POST("/project/recycle", h.recycleProject)                 //删除项目
	group.POST("/project/project_collect/collect", h.collectProject) //收藏项目
	group.POST("/project/edit", h.editProject)                       //编辑项目
}
